// 商品类别
const {DataTypes, db } = require("../db");
db.define('goodsCat', {
id: {type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true,comment:'表自增ID'},
tenantId:{type: DataTypes.INTEGER,comment:''}, 
name:{type: DataTypes.STRING(255),allowNull:false,comment:'名称'}, 
pid:{type: DataTypes.INTEGER,comment:''}, 
code:{type: DataTypes.STRING(255),comment:''}, 
cby:{type: DataTypes.INTEGER,comment:''}, 
ctime:{type: DataTypes.STRING(20),comment:''}, 
uby:{type: DataTypes.INTEGER,comment:''}, 
utime:{type: DataTypes.STRING(20),comment:''}, 
isDel:{type: DataTypes.INTEGER,comment:''}, 
oid:{type: DataTypes.INTEGER,comment:''}, 
pidName:{type: DataTypes.STRING(255),comment:''}, 
pinYin:{type: DataTypes.STRING(255),comment:''}, 
sort:{type: DataTypes.INTEGER,comment:''}, 

}, {
    tableName: 'goods_cat',
    timestamps: false,
    comment: '商品类别',
    indexes: [
        {unique: true, name: '存在相同的名称', fields:['tenantId', 'name']}
    ]
});